Methods and Apparatus for Practical 3D Vision System

ABSTRACT

A method and system for specifying an area of interest in a 3D imaging system including a plurality of cameras that include at least first and second cameras wherein each camera has a field of view arranged along a camera distinct trajectory, the method comprising the steps of presenting a part at a location within the fields of view of the plurality of cameras, indicating on the part an area of interest that is within the field of view of each of the plurality of cameras, for each of the plurality of cameras: (i) acquiring at least one image of the part including the area of interest, (ii) identifying a camera specific field of interest within the field of view of the camera associated with the area of interest in the at least one image and (iii) storing the field of interest for subsequent use.

BACKGROUND OF THE INVENTION

The invention pertains to machine vision and, more particularly, three-dimensional (3D) machine vision. The invention has application in manufacturing, quality control, and robotics, to name but a few fields.

Machine vision refers to the automated analysis of images to determine characteristics of objects represented in them. It is often employed in automated manufacturing lines, where images of components are analyzed to facilitate part-picking, as well as to determine part placement and alignment for assembly. When robots are the means for automated assembly and automated analysis of images is used to facilitate part picking, placement, and alignment, the system is referred to as vision-guided robotics. Machine vision is also used for robot navigation, e.g., to insure the recognition of scenes as robots travel through environments.

Though three-dimensional (3D) analysis has long been discussed in the literature, most present-day machine vision systems rely on two-dimensional (2D) image analysis. This typically necessitates that objects under inspection be “presented to” the vision system in constrained orientations and locations. A conveyor belt is commonly used for this purpose. Objects being assembled or inspected are typically placed at a particular known, stable, 3D configuration on the belt, but at an unknown position and orientation and moved to within the vision system's field of view. Based on an object's 2D pose (i.e., position and orientation) in the field of view, and taking into account that it is disposed on the conveyor (thereby, rendering certain its “lie” and its distance from the vision system camera), the system applies 2D geometry to determine the object's exact 3D pose and/or conformance with expected appearance.

Examples using such 2D vision analysis are provided in prior works of the assignee hereof, including U.S. Pat. No. 6,748,104, entitled “Methods and apparatus for machine vision inspection using single and multiple templates or patterns”, U.S. Pat. No. 6,639,624, entitled “Machine vision methods for inspection of leaded components”, U.S. Pat. No. 6,301,396, entitled “Nonfeedback-based machine vision methods for determining a calibration relationship between a camera and a moveable object”, U.S. Pat. No. 6,137,893, entitled “Machine vision calibration targets and methods of determining their location and orientation in an image”, U.S. Pat. No. 5,978,521, entitled “Machine vision methods using feedback to determine calibration locations of multiple cameras that image a common object”, U.S. Pat. No. 5,978,080, entitled “Machine vision methods using feedback to determine an orientation, pixel width and pixel height of a field of view”, U.S. Pat. No. 5,960,125, entitled “Nonfeedback-based machine vision method for determining a calibration relationship between a camera and a moveable object,” U.S. Pat. No. 6,856,698, entitled “Fast high-accuracy multi-dimensional pattern localization”, U.S. Pat. No. 6,850,646, entitled “Fast high-accuracy multi-dimensional pattern inspection”, and U.S. Pat. No. 6,658,145, entitled “Fast high-accuracy multi-dimensional pattern inspection,” to name a few.

With the increased reliance on robotics, everywhere from the factory floor to the home, the need for practical 3D vision systems has come to the fore. This is because, in many of these environments, objects subject to inspection are not necessarily constrained in overall position and lie, e.g., as might otherwise be the case with objects presented on a conveyor belt. That is, the precise 3D configuration of the object may be unknown.

To accommodate the additional degrees of freedom of pose and position in a 3D scene, 3D vision tools are helpful, if not necessary. Examples of these include U.S. Pat. No. 6,771,808, entitled, “System and method for registering patterns transformed in six degrees of freedom using machine vision”, and U.S. Pat. No. 6,728,582, entitled, “System and method for determining the position of an object in three dimensions using a machine vision system with two cameras.”

Other machine vision techniques have been suggested in the art. Some require too much processor power to be practical for real-time application. Others require that objects subject to inspection go though complex registration procedures and/or that, during runtime, many of the objects' features be simultaneously visible in the vision system field-of-view.

Outside the machine vision realm, the art also provides contact-based methods of determining 3D poses—such as using an x,y,z measuring machine with a touch sensor. However, this requires contact, is relatively slow and can require manual intervention. Electromagnetic wave-based methods for determining 3D poses have also been offered. These do not require physical contact, but suffer their own drawbacks, such as requiring the oft impractical step of affixing transmitters to objects that are subject to inspection.

An object of this invention is to provide improved methods and apparatus for machine vision and, more particularly, for three-dimensional machine vision.

A related object of this invention is to provide such methods and apparatus as have a range of practical applications including, but not limited to, manufacturing, quality control, and robotics.

A further related object of the invention is to provide such methods and apparatus as permit determination of, for example, position and pose in three-dimensional space.

A still further related object of the invention is to provide such methods and apparatus as impose reduced constraints, e.g., as to overall position and lie, of objects under inspection.

Yet still a further related object of the invention is to provide such methods and apparatus as minimize requirements for registration of objects subject to inspection.

Still yet a further object of the invention is to provide such methods and apparatus as can be implemented in present day and future machine vision platforms.

SUMMARY OF THE INVENTION

The foregoing are among the objects attained by the invention, which provides inter alia methods and apparatus for determining the pose, e.g., position along x-, y- and z-axes, pitch, roll and yaw (or one or more characteristics of the pose) of an object in three dimensions by triangulation of data gleaned from multiple images of the object.

Thus, for example, in one aspect, the invention provides a method for 3D machine vision in which, during a calibration step, multiple cameras disposed to acquire images of the object from different respective viewpoints are calibrated to discern a mapping function that identifies rays in 3D space emanating from each respective camera's lens that correspond to pixel locations in that camera's field of view. In a training step, functionality associated with the cameras is trained to recognize expected patterns in images to be acquired of the object. A runtime step triangulates locations in 3D space of one or more of those patterns from pixel-wise positions of those patterns in images of the object and from the mappings discerned during the calibration step.

Further aspects of the invention provide methods as described above in which the runtime step triangulates locations from images of the object taken substantially simultaneously by the multiple cameras.

Still further objects of the invention provide such methods including a re-calibration step in which runtime images of the object are used to discern the aforementioned mapping function, e.g., for a camera that has gone out of calibration. Thus, for example, if one camera produces images in which the patterns appear to lie at locations (e.g., when mapped to the 3D rays for that camera) inconsistent and/or in substantial disagreement with images from the other cameras (e.g., when mapped using their respective 3D rays), pattern locations determined with the images from those other cameras can be used to re-calibrate the one camera.

Yet still further aspects of the invention provide methods as described above in which the calibration step includes positioning registration targets (such as bulls eyes, cross-hairs, or the like, e.g., on calibration plates or otherwise) at known positions in 3D space and recording—or otherwise characterizing, e.g., algorithmically—correlations between those positions and the pixel-wise locations of the respective targets in the cameras' fields of view. Related aspects of the invention provide such methods in which one or more of those registration targets, calibration plates, etc., are used to calibrate multiple cameras at the same time, e.g., by way of simultaneous imaging.

Other aspects of the invention provide methods as described above in which the calibration step includes discerning a mapping function for each camera that takes into account warping in the field of view.

Further aspects of the invention include methods as described above in which the training step includes training functionality associated with the cameras to recognize expected patterns, such as letters, numbers, other symbols (such as registration targets), corners, or other discernible features (such as dark and light spots) of the object and, for example, for which measurement techniques and search/detection models are known in the art.

Further related aspects of the invention provide such methods in which the training step includes training the aforementioned functionality as to the “model points,”—i.e., expected locations in 3D space of the patterns (e.g., in absolute or relative terms) on objects that will be inspected at runtime. In combination with the triangulated 3D locations discerned from those images, that information can be used, during the runtime step, to discern the pose of that object.

According to aspects of the invention, training as to expected locations of the patterns (i.e., model points) includes finding 2D poses of a reference point (or “origin”) of each such pattern. For patterns that are expected to appear in the fields of view of two or more cameras, such reference points facilitate triangulation, as described below, for purposes of determining the position of those patterns (and, therefore, of the object) in 3D space.

Related aspects of the invention provide such methods in which training as to expected patterns includes utilizing—within the functionality associated with each camera—like models for training like expected patterns as between different cameras. This has the benefit of insuring that the reference points (or origins) for patterns found at runtime will coincide as between images obtained by those different cameras.

Further related aspects of the invention provide such methods in which training as to expected patterns includes utilizing—within the functionality associated with each camera—different models for like patterns as between different cameras. This facilitates finding patterns, e.g., when pose, viewing angle and/or obstructions alter the way that different cameras will image those patterns.

Related aspects of the invention provide such methods that include training the selection of reference points (or origins) of patterns so modeled. Such training can be accomplished, for example, by an operator, e.g., using a laser pointer or otherwise, in order to insure that those reference points (or origins) coincide as between images obtained by those different cameras.

Related aspects of the invention provide such methods in which the training step includes discerning the location of the patterns, for example, by utilizing a triangulation methodology similar to that exercised during the runtime phase. Alternatively, the expected (relative) locations of the patterns can be input by the operators and/or discerned by other measurement methodologies.

Further related aspects of the invention provide such methods in which the training step includes finding an expected pattern in an image from one (or more) camera(s) based on prior identification of that pattern in an image from another camera. Thus, for example, once the operator has identified an expected pattern in an image taken from one camera, the training step can include automatically finding that same pattern in images from the other cameras.

Still further aspects of the invention provide methods as described above in which the training step acquires multiple views of the object for each camera, preferably, such that the origins of the patterns found on those objects are consistently defined. To account for potential inconsistency among images, that produce the highest match score for the patterns can be used. This has the benefit of making the methodology more robust to finding parts in arbitrary poses.

Yet in still other aspects of the invention, the runtime step includes triangulating the position of one or more of the patterns in runtime images, e.g., using pattern-matching or other two-dimensional vision tools, and using the mappings discerned during the calibration phase to correlate the pixel-wise locations of those patterns in the respective camera's fields of view with the aforementioned 3D rays on which those patterns lie.

According to related aspects of the invention, triangulation of pattern location may be by “direct” triangulation, e.g., as where the location of a given pattern is determined from the point of intersection (or the point of least squares fit) of multiple 3D rays (from multiple cameras) on which that pattern lies. Alternatively, or in addition, triangulation may be “indirect,” as where the location of a given pattern is determined not only from the ray (or rays) on which that pattern lies, but also from (i) the rays on which the other patterns lie, and (ii) the relative locations of those patterns to one another (e.g., as determined during the training phase).

Other aspects of the invention provide methods as described above in which functionality associated with the cameras “times out” if it fails to find an expected pattern in an image of an object—during training or runtime—thereby avoiding undue delay in position determination, e.g., if such a pattern is missing, occluded or otherwise not detected.

Yet still other aspects of the invention parallel the methods described above in which ID matrix codes (or other patterns whose appearance and/or positions are pre-defined or otherwise known) are used in place of the patterns discussed above. In these aspects of the invention, the training step is obviated or reduced. Instead, the 2D positions of those codes (or other patterns) can be discerned from the training-phase or runtime images, e.g., by vision tools designed for generic types of features, in order to map to 3D locations.

Yet still other aspects of the invention parallel the methods described above in which ID matrix codes (or other patterns whose appearance and/or positions are pre-defined or otherwise known) are used in place of the patterns discussed above. In these aspects of the invention, the training step is obviated or reduced. Instead, the 2D positions of those codes (or other patterns) can be discerned from the training-phase or runtime images, e.g., by vision tools designed for generic types of features, in order to map to 3D locations.

Still other aspects of the invention provide machine vision systems, e.g., including digital processing functionality and cameras, operating in accord with the methods above. These and other aspects of the invention are evident in the drawings and in the description that follows.

A still further related aspect of the invention provides such methods and apparatus as permit the inspection of an object, e.g. to determine and validate relative positions of portions thereof. Such methods and apparatus can be used, by way of non-limiting example, to support inspection and verification, for example, during an assembly, quality assurance, maintenance or other operation.

Further related aspects of the invention provide such methods and apparatus which infer the absence or misplacement of a part (or other portion) of an object in instances where one or more expected patterns (e.g., associated with that part/portion) are absent from runtime images or are present in those images, but at pixel locations that map to 3D locations that are not expected or desirable.

Still further related aspects of the invention provide such methods and apparatus wherein, during the runtime step, the positions of parts or other portions of the object are determined based on subsets of 3D locations corresponding to patterns found in runtime images, and wherein those 3D locations are used to determine expected locations of still further patterns. The expected locations of those further patterns can be compared with their actual 3D locations, e.g., as determined from the runtime images. Where positional differences identified in the comparison exceed a designated tolerance, the system can generate appropriate notifications (e.g., to the operator).

Advantages of systems and methods according to the invention are that they are easier to use and more practical than prior art systems approaches—yet, are vision-based and, hence, do not require contact with or prior preparation of objects subject to inspection. Such systems and methods (according to the invention) can be easily setup, and then trained using “show-and-go”.

In addition, they provide speedy performance and robustness, e.g., with respect to missing and incorrect results. Thus, for example, methods and apparatus according to aspects of the invention can determine the pose of objects even though some patterns are not found in some (and, under some circumstances, any) of the runtime images, e.g., because the patterns are occluded from view by one or more cameras or because images of those patterns could not be timely acquired. By way of further example, methods and apparatus according to aspects of the invention provide robustness with respect to incorrect results (e.g., caused by misaligned cameras) by triangulating using subsets of the 3D locations corresponding patterns found in runtime images: if one of the subsets results in a lower sum-squared error, that subset can be used for position triangulation, rather than all of the patterns.

At least some embodiments include a method for specifying an area of interest in a 3D imaging system including a plurality of cameras that include at least first and second cameras wherein each camera has a field of view arranged along a camera distinct trajectory, the method comprising the steps of presenting a part at a location within the fields of view of the plurality of cameras, indicating on the part an area of interest that is within the field of view of each of the plurality of cameras, for each of the plurality of cameras: (i) acquiring at least one image of the part including the area of interest, (ii) identifying a camera specific field of interest within the field of view of the camera associated with the area of interest in the at least one image and (iii) storing the field of interest for subsequent use.

In some embodiments the step of indicating on the part an area of interest includes indicating at least three points on the part that define the area of interest. In some embodiments the step of indicating at least three points includes using a laser device to sequentially indicate each of the at least three points and wherein the step of acquiring at least one image includes acquiring a separate image for each of the at least three points. In some embodiments the step of identifying a camera specific field of interest includes using multiple acquired images to identify the field of interest.

In some cases the method further includes the steps of, for each point, determining when the point has been identified in at least one image acquired by each camera and indicating when the point has been identified in at least one image acquired by each of the cameras. In some cases the method further includes the steps of, for each point, determining when the point has been identified in at least one image acquired by at least one camera while the point has not been identified in at least one image acquired by at least one other camera.

In some embodiments the step of indicating on the part an area of interest includes using a laser device to indicate the area of interest on the surface of the part by illuminating at least a portion of the part via a laser beam. In some embodiments the laser device includes a button that is selectable to indicate that a currently illuminated portion of the part corresponds to at least some area of interest defining information and that images of the part at the instant that the button is selected should be analyzed to obtain location information associated with the currently illuminated portion of the part, the method further including the step of monitoring for an indication from the laser device.

In some cases the laser device is programmed to, when the button is selected, cause a change in the appearance of the illumination beam on the part, the step of monitoring for an indication from the laser device including analyzing camera images to identify the change in the appearance of the illumination beam on the part. In some cases the method further includes the steps of providing feedback to the system user indicating when camera specific fields of interest have been identified for each of the plurality of cameras. In some embodiments the step of acquiring at least one image includes acquiring images in rapid succession and wherein the step of indicating at least three points includes using a laser device to independently illuminate each of the three points. In some embodiments the step of indicating at least three points includes, for each point, while the laser device illuminates the point, indicating that the illuminated location is one of the points to define the area of interest.

Some embodiments include a method for specifying an area of interest in a 3D imaging system including a plurality of cameras that include at least first and second cameras wherein each camera has a field of view arranged along a camera distinct trajectory, the method comprising the steps of presenting a part at a location within the fields of view of the cameras, using a laser device to sequentially and independently indicate on the part a plurality of points that define an area of interest, for each of the plurality of cameras, while indicating the points on the part, acquiring images of the part including the area of interest, using the points in multiple images for each camera to identify a field of interest in the field of view corresponding to the area of interest and storing the field of interest in the field of view as a camera specific field of interest.

Other embodiments include a system for training a three dimensional vision system to define camera specific fields of interest where an area of interest is indicated on a part, the system comprising a plurality of cameras, each camera having a field of view and arranged along a camera distinct trajectory so that the area of interest is within the field of view of the camera, each camera for obtaining images of the part in the field of view of the camera and a machine vision processor programmed to perform the steps of, for each camera: (i) receiving images, (ii) using at least one of the received images to identify a portion of the field of view of the camera used to generate the image that is associated with the area of interest as a field of interest and (iii) storing the field of interest that is associated with the area of interest as a camera specific field of interest.

In some cases the system further includes a laser pointer device for directing a laser beam toward the part to indicate the area of interest on the part. In some cases the laser pointer device includes a button selectable to indicate that a currently illuminated portion of the part corresponds to at least some area of interest defining information and that images of the part at the instant that the button is selected should be analyzed to obtain location information associated with the currently illuminated portion of the part, the processor further programmed to perform the step of monitoring for an indication from the laser pointer device that images should be analyzed. In some cases the laser pointer device is programmed to, when the button is selected, cause a change in the appearance of the illumination beam on the part, the step of monitoring for an indication from the laser pointer device including analyzing camera images to identify the change in the appearance of the illumination beam on the part. In some embodiments the laser pointer device includes transmitter that transmits a signal when the button is selected.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete understanding of the invention may be attained by reference to the drawings, in which:

FIG. 1 depicts a digital data processor configured for practice of the invention;

FIG. 2 is a flow-chart depicting operation of a system according to the invention;

FIG. 3 depicts calibration of a system according to the invention;

FIGS. 4A-4B depict training and/or runtime operation of a system according to the invention; and

FIG. 5 is a flow chart illustrating a method for training distinct fields of interest for a plurality of cameras in a 3D imaging system.

DETAILED DESCRIPTION OF THE ILLUSTRATED EMBODIMENT

FIG. 1 depicts a machine vision system 10 according to the invention capable of determining the pose of an object 12 in three dimensions by triangulation of data gleaned from multiple images of the object. In the illustrated embodiment, the pose is defined position and orientation of the object in three-dimensional space—or, more precisely, the position of the object along x-, y- and z-axes 14, 16, 18 as well the object's pitch, roll and yaw relative thereto. In other embodiments, pose might be limited to subsets of these spatial characteristics (e.g., position along axis 16 and yaw; position along axes 14-18; roll; etc.). Illustrated axes 14-18 are aligned with a frame 20 of the vision system 10; though, in other embodiments, other frames of reference may be used. Frame 20 of the illustrated embodiment is figuratively represented by camera mounts 20 a and platform 20 b depicted with heavy shading; though, in other embodiments, other or no such members need be employed.

System 10 further includes digital data processor 22 and image acquisition devices 24. Digital data processor 22, here, depicted as an iMac® G5 personal computer for simplicity, may be a mainframe computer, workstation, personal computer (e.g., running a Windows®/Intel Pentium 4 platform, or otherwise), dedicated vision computer, embedded processor or other digital data device, running an proprietary, open source or other operating system, that is programmed or otherwise configured in accord with the teachings hereof to determine the pose of object 12 from images supplied by acquisition devices 24. The digital data processor may include a display 22 a, as shown, as well as keyboard 22 b, mouse 22 c and other input/output devices, all of the type known in the art.

Image acquisition devices 24 may be machine vision cameras, video cameras, still cameras or other devices capable of acquiring images of object 12 in the visible or other relevant spectrum. Without loss of generality, in the text that follows the devices 24 are typically referred to as “cameras”—though, in practice, they may comprise any manner of image acquisition functionality. In the illustrated embodiment, three such devices 24 are shown, though, in practice any plurality of devices (e.g., two or more) may be employed. Those devices are disposed to acquire images of the object 24 from different respective viewpoints. It will also be appreciated to those skilled in the art that, in some embodiments, the 3D pose of an object under inspection can also be determined using images from a single such device 24 and, hence, that not all embodiments require images from multiple cameras.

Digital data processor 22 further includes a central processor (CPU), memory (RAM) and input/output (I/O) functionality of the type known in the art, albeit programmed for operation in accord with the teachings hereof.

Particularly, in the illustrated embodiment, these are configured to provide 3D machine vision in accord with the method shown in FIG. 2. There, in calibration step 30, each of the multiple cameras 24 is calibrated to discern a respective mapping function that identifies rays in 3D space emanating from that camera's lens and that correspond to pixel locations in that camera's field of view.

Referring to FIG. 3, in this regard, the calibration step includes positioning registration targets (such as bulls eyes, cross-hairs, or the like, e.g., on calibration plates 40 or otherwise) at known positions in 3D space and recording—or otherwise characterizing, e.g., algorithmically—correlations between those positions and the pixel-wise locations of the respective targets in the cameras' fields of view. Preferably, this mapping takes into account warping in the field of view of each respective camera 24.

In the illustrated embodiment, the registration targets, calibration plates 40, etc., are used to calibrate multiple cameras 24 at the same time, e.g., by way of simultaneous imaging. Thus, by way of example, the operator can place a target in the field of view of two or more of the image acquisition devices 24, which simultaneously image the target for calibration purposes. Where calibration plates 40, or the like, are used for calibration, they preferably show a fiducial 41 (e.g., a unique pattern which differs from the uniform checkerboard pattern) at an origin so that all acquisition devices 24 can be calibrated with respect to the same unique reference point with specified orientation. By so calibrating the devices 24 in a consistent manner, they can all be used to map from their image coordinates (e.g., the pixel-wise locations of pattern origins) to a common reference point or frame. Preferred such fiducials are asymmetric, as in the case of the L-shaped fiducial in the drawing.

Underlying methodologies and apparatus for such calibration are taught, by way of non-limiting example, in U.S. Pat. No. 6,748,104, entitled “Methods and apparatus for machine vision inspection using single and multiple templates or patterns”, U.S. Pat. No. 6,639,624, entitled “Machine vision methods for inspection of leaded components”, U.S. Pat. No. 6,301,396, entitled “Nonfeedback-based machine vision methods for determining a calibration relationship between a camera and a moveable object”, U.S. Pat. No. 6,137,893, entitled “Machine vision calibration targets and methods of determining their location and orientation in an image”, U.S. Pat. No. 5,978,521, entitled “Machine vision methods using feedback to determine calibration locations of multiple cameras that image a common object”, U.S. Pat. No. 5,978,080, entitled “Machine vision methods using feedback to determine an orientation, pixel width and pixel height of a field of view”, U.S. Pat. No. 5,960,125, entitled “Nonfeedback-based machine vision method for determining a calibration relationship between a camera and a moveable object,” U.S. Pat. No. 6,856,698, entitled “Fast high-accuracy multi-dimensional pattern localization”, U.S. Pat. No. 6,850,646, entitled “Fast high-accuracy multi-dimensional pattern inspection”, and U.S. Pat. No. 6,658,145, entitled “Fast high-accuracy multi-dimensional pattern inspection,” the teachings of all of which are incorporated herein by reference. The methodologies and apparatus described in the latter three patents are referred to elsewhere herein by the name “PatMax.”

In an optional training step 32, a module (e.g., a code sequence, subroutine, function, object, other data structure and/or associated software, or other functionality) associated with each respective camera 24 is trained to recognize expected patterns in images to be acquired, during runtime, of the object 12. These may be letters, numbers, other symbols (such as registration targets), corners, or other features (such as dark and light spots) that are expected to be discernible in the runtime images of the object 12 and, for example, for which measurement techniques and search/detection models are known in the art. Those patterns may be permanently part of, or affixed to, the object. However, they may also be temporary, e.g., as in the case of removable calibration targets. Indeed, they need not be even physically associated with the object. For example, they may be optically or otherwise projected onto objects that are imaged during training and/or runtime phases, e.g., by a laser or other apparatus.

In addition to training the modules or other functionality associated with each camera 24 to recognize pattern, training step 32 of the illustrated embodiment includes training them as to the model point locations, i.e., the expected locations of the patterns, e.g., relative to one another (i.e., in 3D space) on objects that will be inspected during runtime. This can be, for example, by utilizing a triangulation methodology similar to that exercised during the runtime phase. Alternatively, the expected (relative) locations of the patterns can be input by the operator and/or discerned by other measurement methodologies (e.g., rulers, calipers, optical distance gauges, and so forth).

Regardless of whether the triangulation or other methodologies are used, the training step 32 preferably includes training the modules or other functionality or other functionality associated with each camera 24 as to a reference point (or “origin”) of each such trained pattern. For patterns that are expected to appear in the fields of view of two or more cameras, training as to such reference points facilitate direct and indirect triangulating of the position of those patterns and/or of the object in 3D space.

In the illustrated embodiment, such training can be effected by using like models (e.g., “PatMax”, or so forth) for training like expected patterns as between different cameras 24. This has the benefit of insuring that the reference points (or origins) for patterns found at runtime will coincide as between images obtained by those different cameras.

Where pose, viewing angle and/or obstructions alter the way that different cameras 24 will view like patterns, such training can include utilizing different models (for like patterns) as between different cameras. Since different models may tend to identify different reference points for like patterns, the illustrated embodiment permits an operator to train the selection of like reference points for like patterns.

This can be accomplished, by way of example, during training step 32, by simultaneously acquiring images of the pattern from multiple cameras 24 (to be used as a template for searching in step 34) and, then, shining a laser pointer at the object. From images acquired with the laser shining, the 3D location of the laser point can be computed, thereby, defining coincident origins on all images of the patterns. (Though described, here, with respect to use disparate models for pattern training, this technique can be applied, as well, in instances where like models are used). To this end, using the images with and without the superfluous laser pointer spot, autoThresholding and blob analysis can be run to find the center of the spot in all the images, and thereby to determine consistent coincident origins. As discussed elsewhere herein, triangulation can be used to get the 3D position of the spot, thereby, permitting use of this technique for multiple patterns on the (training) object provided, for example, that it does not move.

This can be accomplished, by way of example, during training step 32, by simultaneously acquiring images of the pattern from multiple cameras 24 (to be used as a template for searching in step 34) and, then, shining a laser pointer at the object. From images acquired with the laser shining, the 3D location of the laser point can be computed, thereby, defining coincident origins on all images of the patterns. (Though described, here, with respect to use disparate models for pattern training, this technique can be applied, as well, in instances where like models are used). To this end, using the images with and without the superfluous laser pointer spot, autoThresholding and blob analysis can be run to find the center of the spot in all the images, and thereby to determine consistent coincident origins. As discussed elsewhere herein, triangulation can be used to get the 3D position of the spot, thereby, permitting use of this technique for multiple patterns on the (training) object provided, for example, that it does not move.

According to one preferred practice of the invention, the training step 32 includes finding an expected pattern in an image from one (or more) camera(s) 24 based on prior identification of that pattern in an image from another camera. Thus, for example, once the operator has identified an expected pattern in an image taken from one camera, the training step can include automatically finding that same pattern in images from the other cameras.

In preferred embodiments, step 32 includes acquiring multiple views of the object for each camera 24, preferably, such that the origins of the patterns found on those objects are consistently defined. To account for potential inconsistency among images, those that produce the highest match score for the patterns can be used. This has the benefit of making the methodology more robust to finding parts in arbitrary poses.

As noted above, the training step 32 is optional: in some embodiments of the invention, it is employed in reduced capacity or not at all. For example, if the patterns expected at runtime are susceptible to search via a blob model (e.g., one that looks for bright features), then no patterns training is required—though, position training of the type described above will still be employed. Such is also true, by way of further example, if the patterns are ID matrix codes (or other patterns whose appearance and/or positions are pre-defined or otherwise known) are used in place of the trainable patterns discussed above. Here, the 2D positions of those codes (or other patterns) are discerned from the training-phase or runtime images, e.g., by vision tools designed for generic types of features, in order to map to 3D locations. Such implementations of the invention are useful because industrial parts might always have ID Matrix codes, and multiple training-less sensors could thereby output 3D positions of the ID Matrix code. Furthermore, since an ID Matrix code spans a rectangular area—all of the sensors could output the 2D positions of the 4 corners; furthermore, if the ID Matrix is printed with a particular process, then we can know the 3D positions (by virtue of the found size/type of the code) and compute 3D pose.

In runtime step 34, the digital data processor 22 triangulates locations in 3D space of one or more of patterns 42 a-42 c on the object 12 based on pixel-wise positions of representations of those patterns in runtime images of the object 12 and from the mappings discerned during calibration step 32. In the illustrated embodiment, those runtime images are preferably acquired simultaneously, or substantially simultaneously, of the object 12 by the devices 24. In this regard, substantially simultaneously refers to image acquisition occurring so nearly close in time that movement of the object 12, devices 24, frame 20, or otherwise, does not substantially affect the pixel-wise location of patterns in the runtime images and/or mappings determined therefrom. Such simultaneous acquisition can be achieved by firing the cameras 24 at the same time (or nearly so) or by other means—including, for example, stroboscopically illuminating the imaged object while the camera 24 shutters are open.

In the illustrated embodiment, position triangulation is accomplished using pattern-matching or other two-dimensional vision tools to discern the pixel-wise location of patterns in the runtime images, and using the mappings discerned during the calibration phase to correlate the pixel-wise locations of those patterns in the respective camera's 24 fields of view with the aforementioned 3D rays on which those patterns lie. Examples using such 2D vision tools include aforementioned, incorporated-by-reference U.S. Pat. Nos. 6,748,104, 6,639,624, 6,301,396, 6,137,893, 5,978,521, 5,978,080, 5,960,125, 6,856,698, 6,850,646, and 6,658,145.

Triangulation of pattern location may be by “direct” triangulation, e.g., as where the location of a given pattern is determined from the point of intersection of multiple 3D rays (from multiple cameras) on which that pattern lies. Alternatively, or in addition, triangulation may be “indirect,” as where the location of a given pattern is determined not only from the ray (or rays) on which that pattern lies, but also from (i) the rays on which the other patterns lie, and (ii) the relative locations of those patterns to one another (e.g., as determined during the training phase) on the imaged object.

In the illustrated embodiment, direct and/or indirect triangulation can utilize “least squares fit” or other such methodologies for finding points of intersection (or nearest intersection) as between or among multiple 3D rays (from multiple cameras 24) on which pattern(s) appear to lie. For example, where images acquired from two or more cameras 24 indicate that a given pattern (and, more precisely, the apparent origin of that pattern) lies on two or more rays, a least squares fit methodology can be employed to determine a location of intersection of those rays in 3D space or a nearest point thereto (i.e., a point in space that lies nearest those rays). Likewise, where images from the cameras 24 indicate origins for multiple patterns on multiple rays, a least squares fit can be employed using the model points of those patterns on the object to determine the most likely locations of the patterns and/or the object itself.

The illustrated embodiment utilizes an optimizer (or “solver”) to find the least squares (or root mean square) fit of rays and patterns. This can be a general purpose tool of the type available in the art and/or it can operate in the manner detailed below. In any event, during runtime step 34, the solver is supplied with definitions of the 3D rays on which the patterns (and, more precisely, the pattern origins) identified from the runtime images lie, as well as (where relevant) the locations or relative locations of the patterns on the object.

Typically, this information defines an over-constrained system (i.e., more information is supplied by way of ray definitions and relative pattern locations on the object than is necessary to infer the actual locations), a fact on which the illustrated system capitalizes for purposes of robustness. Thus, for example, the runtime step 34 can determine object pose, e.g., even where patterns are missing from the object or its runtime image (e.g., as where a pattern is occluded from one or more camera views, or where lighting or other conditions to not permit timely acquisition of a pattern image). And, by way of further example, the runtime step 34 can include trying subsets of the pattern origins (and, more precisely, subsets of the locations corresponding to pattern origins) found by the acquisition devices 24 in order to minimize the root mean square (RMS) error of the fit between the rays and the model points or the triangulation of the rays. If one of the subsets has a lower sum squared error, that subset can be used for position triangulation, rather than all of the pattern origins.

Typically, this information defines an over-constrained system (i.e., more information is supplied by way of ray definitions and relative pattern locations on the object than is necessary to infer the actual locations), a fact on which the illustrated system capitalizes for purposes of robustness. Thus, for example, the runtime step 34 can determine object pose, e.g., even when certain patterns are intentionally omitted from consideration (e.g., so as to inspect/validate a pattern's position by comparing it to the position predicted by the other found patterns).

And, by way of further example, the runtime step 34 can include trying subsets of the pattern origins (and, more precisely, subsets of the locations corresponding to pattern origins) found by the acquisition devices 24 in order to minimize the root mean square (RMS) error of the fit between the rays and the model points or the triangulation of the rays. Then, the step can extrapolate the 3D position of the patterns which were not included in the subset (i.e., that were intentionally omitted as mentioned above) and predict the 2D image positions in their respective cameras. The predicted image position can be compared to the actual measured image position: if the distance between the predicted image position and the actual measured image position exceeds some user-specified distance tolerance, then the system can generate an appropriate warning or other notification. Alternatively, or in addition, the extrapolated 3D positions of the omitted patterns can be compared against 3D positions determined by triangulation; again, where the distance between extrapolated (predicted) and actual positions differ, the runtime step 34 can include generating an appropriate warning or other notification.

In order to improve the speed of pattern recognition, during both training and runtime phases, the illustrated embodiment can exploit the found position of one pattern to limit the search degrees of freedom for the other pattern. For example, if a first camera 24 finds the pattern at 15 degrees, and another camera is approximately in the same orientation as the first camera, then it may only need to look for the pattern at orientations 15+/−10 degrees. In addition, given the origin's position from one camera, we know that the origin will lie along a 3D ray; thereby, we can project that ray onto the second camera's field of view, and only look for the pattern along that line.

If two patterns are confusable (i.e., there are two instances similar to the pattern in the camera's field of view), the illustrated embodiment can try all of the different possible correspondences. For example, using the technology described in aforementioned, incorporated-by-reference U.S. Pat. No. 6,856,698, entitled “Fast high-accuracy multi-dimensional pattern localization”, U.S. Pat. No. 6,850,646, entitled “Fast high-accuracy multi-dimensional pattern inspection”, and U.S. Pat. No. 6,658,145, and entitled “Fast high-accuracy multi-dimensional pattern inspection,” patterns such as the character sequences “P”, “ST”, “It”, and “Notes” (from a POST-IT® Notes label) are all different, so when a match is found, we know it is a correct match.

Alternatively, the machine vision tool known as “blob” analysis can be used to find patterns (e.g., if they are dark holes). In this case, it could be hypothesized that blob #1 corresponds to 3Dmodel point 1, and blob#2 corresponds to 3Dmodel point2, etc. If that doesn't work, then the analysis can move on to the next hypothesis: that blob #2 corresponds to 3D model point #2, and blob#1 corresponds to 3D model point #1.

A more complete understanding of the triangulation process of the illustrated embodiment may be appreciated from the discussion that follows.

To intersect n 3D rays (i.e., to find the point which minimizes the sum squared distance to n 3D rays), first characterize each ray as two separate orthogonal planes (since the squared distance from a point to a ray is the sum of the squared distances of the point to two orthogonal planes intersecting that ray). This is exemplified by the C++ code below:

static void solveMinimizeSquareErrorEquations(         const cmStd vector<cc3Vect> &eqs,         const cmStd vector<double> &val,         cc3Vect &ans,         double &rmsError) {  int size = eqs.size( );  assert(size==val.size( ));  ccNMMatrix func(size,3);  ccNMMatrix vals(size,1);  int i;  for (i = 0; i < size; ++i)  {  func.element(i,0,eqs[i].x( ));  func.element(i,1,eqs[i].y( ));  func.element(i,2,eqs[i].z( ));  vals.element(i,0,val[i]);  }  ccNMMatrix func2 = func.Tmultiply(func);  ccNMMatrix vals2 = func.Tmultiply(vals);  double cnum;  ccNMMatrix result =  ccNMMatrix::solve (func2,vals2,true/*symmetric*/,cnum,  HUGE_VAL);  // throw in degenerate cases  if (func2.conditionNumber(false) > 1e12)  throw ccMathError::Singular( );  ans = cc3Vect(result.element(0,0),   result.element(1,0),   result.element(2,0));  double sumSqError = 0;  for (i = 0; i < size; ++i)  {  double error = eqs[i].dot(ans)−val[i];  sumSqError += error*error;  }  rmsError = cfSqrt(sumSqError/size); } void cfComputePerpendiculars(const cc3Vect &start1,     const cc3Vect &end1,     cc3Vect &perp1,     cc3Vect &perp2) {  cc3Vect diff = end1 − start1;  cc3Vect axes[3] = {cc3Vect(1,0,0),     cc3Vect(0,1,0),     cc3Vect(0,0,1)};  cc3Vect crosses[3];  double lens[3];  int i;  for (i = 0; i < 3; ++i)  crosses[i] = diff.cross(axes[i]);  for (i = 0; i < 3; ++i)  lens[i] = crosses[i].dot(crosses[i]);  int j;  for (i = 0; i < 2; ++i)  for (j = i+1; j < 3; ++j)   if (lens[i] < lens[j])   {   double tmp = lens[i];   lens[i] = lens[j];   lens[j] = tmp;   cc3Vect cross = crosses[i];   crosses[i] = crosses[j];   crosses[j] = cross;   }  perp1 = crosses[0] * 1./lens[0];  perp2 = crosses[1] * 1./lens[1]; } static void intersectLinesInThreeSpace (const cmStd vector<cc3DLineSeg> &segs,  cc3Vect &intersection,  double &rmsError) {  // Find point which minimizes total squared error between  // segs.size( )*2 planes  int size = segs.size( );  cmStd vector<cc3Vect> eqs(size*2);  cmStd vector<double> vals(size*2);  int i;  for (i = 0; i < size; ++i)  {  cfComputePerpendiculars(segs[i].p1( ),segs[i].p2( ),eqs[i*2],  eqs[i*2+1]);  vals[i*2] = segs[i].p1( ).dot(eqs[i*2]);  vals[i*2+1] = segs[i].p1( ).dot(eqs[i*2+1]);  }  solveMinimizeSquareErrorEquations(eqs,vals,intersection,rmsError); }

To solve for the pose which best maps the 3D points onto the corresponding 3D rays, we can say that we use the following equations (which are expressed in the Maple math package, which is commercially available from Maplesoft, a division of Waterloo Maple) which is used to generate optimized C code.

The approach solves for the pose (which is expressed in terms of the variables a,b,c,d,tx,ty,tz) which minimizes the sum squared error between points p (which are expressed as x,y,z) and planes expressed as (px, py, pz, pt). Note that each 3d ray corresponds to two such plane constraints. The approach computes the sum squared error by summing up the coefficients of the algebraic error function. And then, the approach solves for the optimal a,b,c,d,tx,ty,tz using gradient descent. Note that since there are 7 variables (a,b,c,d,tx,ty,tz) and only 6 degrees of freedom, we try 4 different cases—where a is set to 1 and the variables are b,c,d; where b is set to 1 and the variables are a,c,d; where c is set to 1 and the variables are a,b,d; and where d is set to 1 and the variables are a,b,c.

quatRot :=  matrix(4,4,   [[a*a+b*b−c*c−d*d,2*b*c−2*a*d,2*a*c+2*b*d,tx],    [2*a*d+2*b*c,a*a−b*b+c*c−d*d,2*c*d−2*a*b,ty],    [2*b*d−2*a*c,2*a*b+2*c*d,a*a−b*b−c*c+d*d,tz],    [0,0,0,a*a+b*b+c*c+d*d]]); val := matrix(1,4,[x,y,z,1]); dot := matrix(1,4,[px,py,pz,pt]); pos := multiply(quatRot,transpose(val)); unit := (a*a+b*b+c*c+d*d); weightMat := multiply(dot,pos); weight := weightMat[1,1]/unit; weightSq := expand(weight*weight); weightSqDA := simplify(expand(diff(weightSq,a)*unit*unit)); weightSqDB := simplify(expand(diff(weightSq,b)*unit*unit)); weightSqDC := simplify(expand(diff(weightSq,c)*unit*unit)); weightSqDD := simplify(expand(diff(weightSq,d)*unit*unit)); weightSqDTX := simplify(expand(diff(weightSq,tx)*unit*unit)); weightSqDTY := simplify(expand(diff(weightSq,ty)*unit*unit)); weightSqDTZ := simplify(expand(diff(weightSq,tz)*unit*unit));

The foregoing will be further appreciated in view of the following, in which GenericPoly( ) is a function which extracts the coefficients of a function. Thus, if the function is x*x+2*x*y+y*y, then the generic function is f0x2y0*x*x+f0x1y1*x*y+f0x0y2*y*y where f0x2y0=1, f0x1y1=2, f0x0y2=1. GenericPoly( ) is included in MARS, a Maple Matlab Resultant Solver system publicly and freely available, e.g., by way of non-limiting example from www.cs.unc.edu/˜geom/MARS.

read(‘genericpoly.map‘); genPoly:= GenericPoly(expand(eval(weightMat[1,1]*weightMat[1,1])), array(1..7,[a,b,c,d,tx,ty,tz]),‘f’); genPolyDA := simplify(expand(unit*diff(eval(genPoly[1]),a)−eval(genPoly[1])*4*a)); genPolyDB := simplify(expand(unit*diff(eval(genPoly[1]),b)−eval(genPoly[1])*4*b)); genPolyDC := simplify(expand(unit*diff(eval(genPoly[1]),c)−eval(genPoly[1])*4*c)); genPolyDD := simplify(expand(unit*diff(eval(genPoly[1]),d)−eval(genPoly[1])*4*d)); genPolyDTX := simplify(expand(diff(eval(genPoly[1]),tx))); genPolyDTY := simplify(expand(diff(eval(genPoly[1]),ty))); genPolyDTZ := simplify(expand(diff(eval(genPoly[1]),tz))); C(genPolyDA); C(genPolyDB); C(genPolyDC); C(genPolyDD); C(genPolyDTX); C(genPolyDTY); C(genPolyDTZ);

(Note that since the error function is not just derivative(weightMat*weightMat) but it is actually (a*a+b*b+c*c+d*d)*derivative(weightMat*weightMat) minus 4*a*weightMat*weightMat (for computing the partial derivative with respect to a) (which is written as:

unit*diff(eval(genPoly[1]),a)−eval(genPoly[1])*4*a));)

because of the chain rule for quotients:

deriv(F(x)/G(x))==(G(x)*F′(x)−F(x)*G′(x))/(G(x)*G(x))

note that we can ignore the square of the denominator (in the denominator of the chain rule for partial derivatives) for this analysis because the denominator (a*a+b*b+c*c+d*d) applies uniformly to all partial derivatives:

d((a*a+b*b+c*c+d*d)̂2)/da=4*a*(a*a+b*b+c*c+d*d))

By way of further explanation of the foregoing, numerical gradient descent methods make use of an error function, as well as derivatives of that error function. The derivates of an error function can be computed numerically or symbolically. For numerically-computed derivates, one can simply change one of the variables by a small amount, and then recompute the error function, and thusly numerically compute the derivative. For symbolically computed derivatives, one needs a symbolic function corresponding to the derivative—which we have in this case because we have the algebraic expressions describing the error function, and we can symbolically differentiate that algebraic error function.

In the illustrated embodiment, a C data structure keeps all of the coefficients for the algebraic expression, as follows:

typedef struct ptRayGenericPoly {  double fa0b0c0d0tx0ty0tz2 ;  double fa0b0c0d0tx0ty1tz1 ;  double fa0b0c0d0tx0ty2tz0 ;  double fa0b0c0d0tx1ty0tz1 ;  double fa0b0c0d0tx1ty1tz0 ;  double fa0b0c0d0tx2ty0tz0 ;  double fa0b0c0d2tx0ty0tz1 ;  double fa0b0c0d2tx0ty1tz0 ;  double fa0b0c0d2tx1ty0tz0 ;  double fa0b0c0d4tx0ty0tz0 ;  double fa0b0c1d1tx0ty0tz1 ;  double fa0b0c1d1tx0ty1tz0 ;  double fa0b0c1d1tx1ty0tz0 ;  double fa0b0c1d3tx0ty0tz0 ;  double fa0b0c2d0tx0ty0tz1 ;  double fa0b0c2d0tx0ty1tz0 ;  double fa0b0c2d0tx1ty0tz0 ;  double fa0b0c2d2tx0ty0tz0 ;  double fa0b0c3d1tx0ty0tz0 ;  double fa0b0c4d0tx0ty0tz0 ;  double fa0b1c0d1tx0ty0tz1 ;  double fa0b1c0d1tx0ty1tz0 ;  double fa0b1c0d1tx1ty0tz0 ;  double fa0b1c0d3tx0ty0tz0 ;  double fa0b1c1d0tx0ty0tz1 ;  double fa0b1c1d0tx0ty1tz0 ;  double fa0b1c1d0tx1ty0tz0 ;  double fa0b1c1d2tx0ty0tz0 ;  double fa0b1c2d1tx0ty0tz0 ;  double fa0b1c3d0tx0ty0tz0 ;  double fa0b2c0d0tx0ty0tz1 ;  double fa0b2c0d0tx0ty1tz0 ;  double fa0b2c0d0tx1ty0tz0 ;  double fa0b2c0d2tx0ty0tz0 ;  double fa0b2c1d1tx0ty0tz0 ;  double fa0b2c2d0tx0ty0tz0 ;  double fa0b3c0d1tx0ty0tz0 ;  double fa0b3c1d0tx0ty0tz0 ;  double fa0b4c0d0tx0ty0tz0 ;  double fa1b0c0d1tx0ty0tz1 ;  double fa1b0c0d1tx0ty1tz0 ;  double fa1b0c0d1tx1ty0tz0 ;  double fa1b0c0d3tx0ty0tz0 ;  double fa1b0c1d0tx0ty0tz1 ;  double fa1b0c1d0tx0ty1tz0 ;  double fa1b0c1d0tx1ty0tz0 ;  double fa1b0c1d2tx0ty0tz0 ;  double fa1b0c2d1tx0ty0tz0 ;  double fa1b0c3d0tx0ty0tz0 ;  double fa1b1c0d0tx0ty0tz1 ;  double fa1b1c0d0tx0ty1tz0 ;  double fa1b1c0d0tx1ty0tz0 ;  double fa1b1c0d2tx0ty0tz0 ;  double fa1b1c1d1tx0ty0tz0 ;  double fa1b1c2d0tx0ty0tz0 ;  double fa1b2c0d1tx0ty0tz0 ;  double fa1b2c1d0tx0ty0tz0 ;  double fa1b3c0d0tx0ty0tz0 ;  double fa2b0c0d0tx0ty0tz1 ;  double fa2b0c0d0tx0ty1tz0 ;  double fa2b0c0d0tx1ty0tz0 ;  double fa2b0c0d2tx0ty0tz0 ;  double fa2b0c1d1tx0ty0tz0 ;  double fa2b0c2d0tx0ty0tz0 ;  double fa2b1c0d1tx0ty0tz0 ;  double fa2b1c1d0tx0ty0tz0 ;  double fa2b2c0d0tx0ty0tz0 ;  double fa3b0c0d1tx0ty0tz0 ;  double fa3b0c1d0tx0ty0tz0 ;  double fa3b1c0d0tx0ty0tz0 ;  double fa4b0c0d0tx0ty0tz0 ; } ptRayGenericPoly;

The illustrated embodiment also utilizes a function which adds to the coefficients of the algebraic expression (those functions take as input a 3D point (x,y,z) and a corresponding plane—characterized by px,py,pz,pt):

void ptRayGenericPoly_addToVals(ptRayGenericPoly *vals, double x, double y, double z, double px, double py, double pz, double pt);

The illustrated embodiment also utilizes a function which computes the error at a given pose (a,b,c,d,tx,ty,tz) where (a,b,c,d) are quaternion representation of the 3D rotation (roll,pitch,yaw), and (tx,ty,tz) are the translation:

double ptRayGenericPoly_eval(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz);

The illustrated embodiment also provide functions which compute the derivatives:

double ptRayGenericPoly_DA(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz); double ptRayGenericPoly_DB(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz); double ptRayGenericPoly_DC(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz); double ptRayGenericPoly_DD(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz); double ptRayGenericPoly_DTX(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz); double ptRayGenericPoly_DTY(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz); double ptRayGenericPoly_DTZ(const ptRayGenericPoly *vals, double a, double b, double c, double d, double tx, double ty, double tz);

For example, the function which adds to the coefficients can be expressed in a manner consistent with the exemplary excerpts that follow; the complete function is evident in view of the teachings hereof and the Maple code provided:

void ptRayGenericPoly_addToVals(ptRayGenericPoly *vals,    double x,    double y,    double z,    double px,    double py,    double pz,    double pt) {  double x_2 = x*x;  double y_2 = y*y;  double z_2 = z*z;  double px_2 = px*px;  double py_2 = py*py;  double pz_2 = pz*pz;  double pt_2 = pt*pt;  vals->fa0b0c0d0tx0ty0tz2 += pz_2;  vals->fa0b0c0d0tx0ty1tz1 += 2*py*pz;  vals->fa0b0c0d0tx0ty2tz0 += py_2;  vals->fa0b0c0d0tx1ty0tz1 += 2*pz*px;  vals->fa0b0c0d0tx1ty1tz0 += 2*py*px;  vals->fa0b0c0d0tx2ty0tz0 += px_2;  vals->fa0b0c0d2tx0ty0tz1 +=  2*pt*pz+2*pz_2*z−2*py*y*pz−2*px*x*pz;  vals->fa0b0c0d2tx0ty1tz0 +=  2*pt*py−2*py_2*y−2*px*x*py+2*pz*z*py;  vals->fa0b0c0d2tx1ty0tz0 +=  2*pt*px−2*px_2*x−2*py*y*px+2*pz*z*px;  vals->fa0b0c0d4tx0ty0tz0 += pz_2*z_2+px_2*x_2+     py_2*y_2+pt_2+2*pz*z*pt−2*px*x*pt−     2*py*y*pt+2*px*x*py*y−2*px*x*pz*z−   2*py*y*pz*z;  vals->fa0b0c1d1tx0ty0tz1 += 4*pz*z*py+4*pz_2*y;  ...

Note that the way that this works is that the fa . . . 's are the coefficients and that the names of the variables encode the degree of each monomial

F(a,b,c,d,tx,ty,tz) = fa0b0c0d0tx0ty0tz0+ fa0b0c0d0tx0ty0tz1 * tz + fa0b0c0d0tx0ty0tz2 * tz{circumflex over ( )}2 + fa0b0c0d0tx0ty1tz1 * ty * tz + ... And that you start with a generic zero error function fa0b0c0d0tx0ty0tz0 = 0 fa0b0c0d0tx0ty0tz1 = 0 ...

Following, this a call is made to a function ptRayGenericPoly_addToVals( ) for each set of points, plane (characterized by (x,y,z,px,py,pz,pt)) and it accumulates the monomial coefficients into the sum error function.

Referring to optional step 36 of FIG. 2, the illustrated system 10 can re-calibrate image acquisition devices 24 that have gone out of alignment, e.g., if one of the cameras is nudged following calibration. (In this regard, it will be appreciated that in the illustrated embodiment, it is preferably intended that the cameras 24 remain fixed and/or stationary after calibration in order to preserve mappings determined during the calibration phase). This may be detected during location triangulation carried out in step 34 and, possible, during that carried out in step 32. To this end, if one camera 24 produces images in which the patterns found in runtime images of an object under inspection appear to lie at locations (e.g., when mapped to the 3D rays for that camera) inconsistent and/or in substantial disagreement with images from the other cameras (e.g., when mapped using their respective 3D rays), pattern locations determined with the images from those other cameras can be used to re-calibrate the one camera using the same calibration methodology described above in connection with step 30.

In this regard, it will be appreciated that the mappings determined in step 30 (as well as in step 36) are decomposable into two separate effects: lens distortion, such as pincushioning and other image aberrations, which will remain constant if the camera 24 is nudged (because it is only a function of the lens and because, for example, the lens can be glued in place with respect to the CCD, CMOS or other image sensor), and the pose of the camera 24 with respect to the workspace. It is the latter—the pose—that will change if the camera is nudged. In step 36, that aspect of the mapping attributable to the pose of the camera in the workspace can be recomputed, e.g., without requiring a calibration plate, because the lens distortion is assumed to remains constant.

Illustrated system 10 preferably includes a “time out” feature that prevents undue delay in instances where an expected pattern is not detected in an image acquired during runtime phase 34. In this regard, the system simply treats a pattern that is not detected within a designated delay interval (e.g., set by the operator or otherwise) as not found and proceeds with position determination on the basis of the other, found patterns. This has the benefit of making the system 10 more robust with respect to missing features and its operation more timely.

In at least some embodiments a particular machine vision process may require or be optimized by a system user identifying one or more specific areas within obtained images of a part to be examined or analyzed. For instance, in the case of a first part being inspected, a system user may know that a pattern of interest will always be located within a camera's field of view so that the pattern will appear in the upper left-hand quarter of images generated by the camera. In this case, to speed up the pattern recognition process, it would be optimal for a camera processor to restrict searching for the pattern to the upper left-hand quarter of an obtained image. Here, where a second camera also obtains images of instances of the first part simultaneously with the first camera, the pattern may always appear in the lower right-hand quarter of the second camera's field of view so that it would be optimal for a processor that processes images from the second camera to restrict searching for the pattern to the lower right-hand corner. Similarly, where a system includes third, fourth, etc., cameras, image processing for pattern recognition may be optimally restricted to only portions of the camera images.

In at least some embodiments it is contemplated that during a training process, a user may perform an area of interest (AOI) training procedure whereby, with an ideal part positioned within a field of view of two or more cameras, the user manually identifies points on the part that together define an area of interest that should be examined or analyzed in obtained images. Images are obtained using the two or more cameras in which the points selected by the user are discernable by the computer CPU/processor (see FIG. 1). Thereafter, the processor stores the coordinates of the selected points in the obtained images to define separate “fields of interest” (FOIs) corresponding to the area of interest for each of the cameras.

While the points in the separate images correspond to the same selected points on the part being imaged, the fields of interest (i.e., portions of images) that correspond to the selected points are different for each camera because each camera is oriented differently with respect to the part and selected points. Thus, for instance, while four selected points may define a square in an image generated using a first camera with its field of view arranged along a first trajectory, the same four points may define a rectangle, trapezoid, or other quadrilateral in an image generated using a second camera with its field of view arranged along a second trajectory.

It should be appreciated that this AOI training procedure is relatively simple and ensures that each camera in a multi-camera 3D system is calibrated to examine or analyze the exact same area or region of a part. It should be appreciated that all of the camera specific fields of interest can be trained simultaneously during a single AOI training procedure.

Several different methods are contemplated for indicating or specifying an AOI during the commissioning procedure. For instance, in some cases a system user may employ a manual laser pointer 80 to point out selected points on a part 12 one point at a time. Here, while a first point is selected via the laser pointer, the cameras can be controlled to obtain simultaneous images.

In at least some cases the manual laser pointer may include a transmitter and a button where, when the button is selected, the pointer transmitter transmits a signal to a receiver linked to computer 22 a (see again FIG. 1) indicating that images corresponding to that instant in time should be examined to identify the locations within the images of the laser illuminated point. In other cases, some activity of the laser within a series of obtained images may indicate to the computer processor that a point has been selected. For instance, pointer 80 may be on and generating a laser beam in steady state but may blink off and on twice when a pointer button is selected. Here where each camera obtains a series of images in rapid succession during the AOI training procedure, the computer processor may be programmed to recognize the blinking illuminated point as a signal that the point has been selected and that associated images should be examined to identify the locations within the images of the laser illuminated point. In still other cases a user may simply select a key via keyboard 22 b to indicate that images at a specific instant should be analyzed to identify the locations of an illuminated point in each image.

Next, the user can use the pointer 80 to select a second area defining point and cause the cameras to simultaneously obtain images, followed by selection of a third point needed, and so on. Once images including all points needed to define the AOI have been captured, the computer processor can identify FOIs for each of the separate cameras for subsequent use. After camera specific FOIs have been stored, during normal operation, when a part is subsequently imaged, the processor may analyze only the FOIs in images for the specific cameras.

While some embodiments may require that a user select four points to define generally rectilinear AOI's, in at least some embodiments more or less points may be used, at the user's discretion, to define other AOI shapes. For instance, three points may be specified/selected to specify a triangle, five points may specify a pentagon, etc.

As another instance, a laser light source may be programmed to rapidly scan a laser beam so as to form a square (see 82 FIG. 1), a rectangle, a triangle, a circle, etc., AOI boundary where the AOI boundary can be directed toward and to subtend a surface of a part 12 to define an AOI. Here, each camera may only need to take a single image of the part and the camera processor(s) may be programmed to “learn” the camera specific FOIs therefrom. Here, again, the signal to indicate that an AOI has been selected may be facilitated via a laser pointer to computer processor transmission, some activity that can be sensed by the computer processor when a pointer button is selected (e.g., blinking on-off of the AOI boundary, a change in AOI boundary intensity, a rapid change from an AOI boundary to a set of boundary defining points, etc.), selection of a computer keyboard button, etc.

As still one other instance, a system user may apply stickers or the like to a part during an AOI training procedure. After the stickers are applied to define an AOI, images are obtained via multiple cameras, the computer processor identifies the camera specific FOIs in each image corresponding to the sticker locations and subsequently uses the camera specific FOIs accordingly.

In at least some embodiments it is contemplated that each camera may operate during an AOI training procedure to obtain multiple images in rapid succession. In this case, in at least some embodiments, a laser may be used to “draw” a box, circle, etc., AOI boundary around an AOI while images are obtained where the computer processor is programmed to use laser point location information from the multiple images for each camera to create camera specific FOIs.

In at least some embodiments it is contemplated that the computer processor may be programmed to provide at least some feedback to a system user during an AOI training procedure. For instance, in a case where a system includes three cameras and a user selects one point via a laser pointer, if the cameras obtain images but the images(s) associated with one or more of the cameras do not include a point illuminated by the laser at the instance indicated by the user, either the processor may indicate that a different point should be selected via a beep or the like or the processor may not indicate that the point was captured (i.e., beep may only be provided when points in images for all cameras have been identified) thereby prompting the user to select another point. As another instance, where the images associated with two out of three system cameras can be used to discern four selected points while images associated with the third camera can only be used to discern two selected points in simultaneously obtained images, the processor may indicate that the training process was unsuccessful. As one more instance, where a laser is used to “draw” an AOI boundary on a part while cameras take a rapid succession of images, the processor may be programmed to recognize when an outline has been closed (i.e., an intersection occurs) and may indicate closure via a beep or the like. Feedback may also be visual via the computer display screen 22 a.

In at least some embodiments, in addition to using an AOI training procedure to define camera specific AOIs for subsequent use, a similar training procedure may be used during a pattern/model training session to indicate an area/region on a part for which a model pattern should be created. For instance, a user may employ laser pointer 80 or the like to define an AOI on a part including specific features of interest and the computer processor may then run a separate model generating process for each of the camera specific FOIs specified by the user.

Referring to FIG. 5, an exemplary AOI training procedure 50 is illustrated. At block 52, the AOI training procedure is commenced. Here, to start the procedure a user may indicate via computer 22 (or via the laser pointer 80) that the procedure should start (see FIG. 1). At block 54 the user indicates AOI points on a part (see 12 in FIG. 1) that is in the field of view of the system cameras 24. In the present example, points to define the AOI are indicated via laser pointer 80 as in FIG. 1 although any other manner taught above or equivalent to the teachings above may be used.

At block 56, cameras 24 are used to obtain images of the part 12. At block 58 the images are examined by the computer processor to identify the selected points that define the AOI. At block 60 the processor determines if the AOI defining points have been located in at least one image associated with each camera. Where the AOI defining points have not all been identified, control passes back up to block 54 where the process continues to loop. Optimally at block 55 feedback may be provided to the system user. Once all the AOI defining points have been identified, at block 62 the FOIs for each camera are stored and at block 64 feedback (e.g., a beep) is provided to the user indicating that the AOI training procedure has been completed for the current AOI. Where a user wants to define a second AOI for the part, the process 50 may be repeated.

Described above are methods and apparatus meeting the objects set forth above, among others. It will be appreciated that the methods and apparatus shown in the drawings and described above are merely examples of embodiments of the invention, and that other embodiments incorporating changes therein fall within the scope of the invention. In view of the foregoing, what we claim is: 

1. A method for specifying an area of interest in a 3D imaging system including a plurality of cameras that include at least first and second cameras wherein each camera has a field of view arranged along a camera distinct trajectory, the method comprising the steps of: presenting a part at a location within the fields of view of the plurality of cameras; indicating on the part an area of interest that is within the field of view of each of the plurality of cameras; for each of the plurality of cameras: (i) acquiring at least one image of the part including the area of interest; (ii) identifying a camera specific field of interest within the field of view of the camera associated with the area of interest in the at least one image; and (iii) storing the field of interest for subsequent use.
 2. The method of claim 1 wherein the step of indicating on the part an area of interest includes indicating at least three points on the part that define the area of interest.
 3. The method of claim 2 wherein the step of indicating at least three points includes using a laser device to sequentially indicate each of the at least three points and wherein the step of acquiring at least one image includes acquiring a separate image for each of the at least three points.
 4. The method of claim 3 wherein the step of identifying a camera specific field of interest includes using multiple acquired images to identify the field of interest.
 5. The method of claim 3 further including the steps of, for each point, determining when the point has been identified in at least one image acquired by each camera and indicating when the point has been identified in at least one image acquired by each of the cameras.
 6. The method of claim 3 further including the steps of, for each point, determining when the point has been identified in at least one image acquired by at least one camera while the point has not been identified in at least one image acquired by at least one other camera.
 7. The method of claim 1 wherein the step of indicating on the part an area of interest includes using a laser device to indicate the area of interest on the surface of the part by illuminating at least a portion of the part via a laser beam.
 8. The method of claim 7 wherein the laser device includes a button that is selectable to indicate that a currently illuminated portion of the part corresponds to at least some area of interest defining information and that images of the part at the instant that the button is selected should be analyzed to obtain location information associated with the currently illuminated portion of the part, the method further including the step of monitoring for an indication from the laser device.
 9. The method of claim 8 wherein the laser device is programmed to, when the button is selected, cause a change in the appearance of the illumination beam on the part, the step of monitoring for an indication from the laser device including analyzing camera images to identify the change in the appearance of the illumination beam on the part.
 10. The method of claim 1 further including the steps of providing feedback to the system user indicating when camera specific fields of interest have been identified for each of the plurality of cameras.
 11. The method of claim 2 wherein the step of acquiring at least one image includes acquiring images in rapid succession and wherein the step of indicating at least three points includes using a laser device to independently illuminate each of the three points.
 12. The method of claim 11 wherein the step of indicating at least three points includes, for each point, while the laser device illuminates the point, indicating that the illuminated location is one of the points to define the area of interest.
 13. A method for specifying an area of interest in a 3D imaging system including a plurality of cameras that include at least first and second cameras wherein each camera has a field of view arranged along a camera distinct trajectory, the method comprising the steps of: presenting a part at a location within the fields of view of the cameras; using a laser device to sequentially and independently indicate on the part a plurality of points that define an area of interest; for each of the plurality of cameras, while indicating the points on the part, acquiring images of the part including the area of interest; using the points in multiple images for each camera to identify a field of interest in the field of view corresponding to the area of interest; and storing the field of interest in the field of view as a camera specific field of interest.
 14. A system for training a three dimensional vision system to define camera specific fields of interest where an area of interest is indicated on a part, the system comprising: a plurality of cameras, each camera having a field of view and arranged along a camera distinct trajectory so that the area of interest is within the field of view of the camera, each camera for obtaining images of the part in the field of view of the camera; and a machine vision processor programmed to perform the steps of, for each camera: (i) receiving images; (ii) using at least one of the received images to identify a portion of the field of view of the camera used to generate the image that is associated with the area of interest as a field of interest; and (iii) storing the field of interest that is associated with the area of interest as a camera specific field of interest.
 15. The system of claim 14 further including a laser pointer device for directing a laser beam toward the part to indicate the area of interest on the part.
 16. The system of claim 15 wherein the laser pointer device includes a button selectable to indicate that a currently illuminated portion of the part corresponds to at least some area of interest defining information and that images of the part at the instant that the button is selected should be analyzed to obtain location information associated with the currently illuminated portion of the part, the processor further programmed to perform the step of monitoring for an indication from the laser pointer device that images should be analyzed.
 17. The system of claim 16 wherein the laser pointer device is programmed to, when the button is selected, cause a change in the appearance of the illumination beam on the part, the step of monitoring for an indication from the laser pointer device including analyzing camera images to identify the change in the appearance of the illumination beam on the part.
 18. The system of claim 16 wherein the laser pointer device includes transmitter that transmits a signal when the button is selected. 